<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/5/15
 * Time: 11:51
 */

namespace app\common\model;


use think\Model;

class Tag extends Model
{
    protected  $autoWriteTimestamp = true;
    public function add($data) {
        $data['status'] = 1;
        //$data['create_time'] = time();
        $result =  $this->save($data);
        //echo $this->getLastSql();exit;
        return $result;
    }
    public function getTagsInfo()
    {
        $data= [
            'status' => ['neq',-1]
        ];
        $order = [
            'id' => 'desc'
        ];
        $result = $this -> where($data)
            -> order($order)
            -> select();
        return $result;

    }

    public function getNormalTagsInfo()
    {
        $data= [
            'status' => ['eq',1]
        ];
        $order = [
            'id' => 'desc'
        ];
        $result = $this -> where($data)
            -> order($order)
            -> select();
        return $result;

    }

}